<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="/struts-tags" %>

<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>UserView</title>
</head>
<body>

<% if (request.getParameter("id") != null) { %>
<h1>请输入搜索ID-传统方法获取单个参数的值! ${ pageContext.request.getParameter("id") }</h1>
<h1>请输入搜索ID-获取单个参数的值! ${ param.id }</h1>
<h1>请输入搜索ID-所有可访问作用域中存在的属性! ${ id }</h1>
<% } %>

<s:form namespace="/user" action="search" method="POST">
  <s:if test="%{ id!=null }">
    <s:hidden name="id"/>
  </s:if>
  <s:else>
    <s:textfield name="id"/>
  </s:else>
  <s:textfield type="submit"/>
</s:form>
</body>
</html>
